package com.ys.data.auth.config;

import com.ys.data.auth.filter.JwtFilter;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import javax.annotation.Resource;
import java.util.Arrays;

/**
* @version: V1.0
* @author: szw
* @className: InterceptorConfig
* @packageName: InterceptorConfig
* @description: jwt校验过滤配置类
* @data: 2021-1-19 
**/
//暂时不开启jwater校验
//@Configuration 
public class InterceptorConfig extends WebMvcConfigurationSupport {

    @Resource
    private JwtFilter jwtFilter;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(jwtFilter).addPathPatterns("/**")
                .excludePathPatterns(Arrays.asList("/", "/login"));
    }
}
